import request from "./request"


//



// 请求首页数据
const indexUrl = "/index/queryIndexCategoryTabContent?moduleKey="

export let initHomeData = ()=>{
    return request({
        url:"/index/queryIndexTabModule",
        method:"GET"
    })
}

//首页其他Tab分类列表
export let initTabHomeData = (moduleKey)=>{
    return request({
        url:"/index/queryIndexCategoryTabContent?moduleKey="+moduleKey,
        method:"GET"
    })
}

// 有声书
export let initHomeIndexData = (url)=>{
    return request({
        url:indexUrl+url,
        method:"GET"
    })
}

// 排行榜
export let initRankData = (url)=>{
    return request({
        url:'/rank/queryRankClusterDetail',
        method:"GET"
    })
}

// 排行榜列表

export let initRankListData = (clusterCode,categoryCode)=>{
    return request({
        url:'/rank/queryRank?clusterCode='+clusterCode+'&categoryCode='+categoryCode,
        method:"GET"
    })
}


// 获取专辑详情
export let initAlbumDetailData = (id) =>{
    return request({
        url:"/album/queryAlbumPage/"+id,
        method:"GET"
    })
}


// 获取主播详情
export let initzhuboDetailData = (id) =>{
    return request({
        url:"/anchor/queryAnchorPage/"+id,
        method:"GET"
    })
}
// 音轨列表
export let initAlbumListData = (data)=>{
    return request({
        url:"album/queryAlbumTrackRecordsByPage",
        method:"GET",
        params:data,
    })
}
// 相似专辑
export let initXsAlbumListData = (data)=>{
    return request({
        url:"/album/queryAlbumRelatedRecommendAlbums",
        method:"GET",
        params:data,
    })
}
// 经典必听
export let initJdAlbumListData = (data)=>{
    return request({
        url:"https://apis.netstart.cn/ximalaya/album/queryClassicListenAlbums",
        method:"GET",
        params:data,
    })
}

// 主播的简介
export let initZbData = (anchorid)=>{
    return request({
        url:"/anchor/queryUserInfo/"+anchorid,
        method:"GET",
        
    })
}
// 主播详情
export let initZbDetailData = (anchorid,pageSize,tabType)=>{
    return request({
        url:"/anchor/queryAnchorPage/"+anchorid+"?pageSize="+pageSize+"&tabType="+tabType,
        method:"GET",
        
    })
}

// 更多主播专辑
export let initZbAlbumListlData = (params)=>{
    return request({
        url:"/anchor/queryAnchorAlbumsByPage",
        method:"GET",
        params
    })
}
// 更多主播专辑
export let initZbSoundListlData = (params)=>{
    return request({
        url:"/anchor/queryAnchorTracksByPage",
       
        method:"GET",
        params
    })
}

// 音轨详情、
export let initSoundData = (id)=>{
    return request({
        url:"/track/queryTrackPage/"+id,
        // url:"/anchor/queryAnchorTracksByPage?anchorId=2629577&page=2&pageSize=20&asc=false",
        // url:"/anchor/queryAnchorTracksByPage",
        method:"GET",
        
    })
}
// 音轨评论
export let initSoundCommentData = (data)=>{
    return request({
        url:"/track/queryTrackCommentsFirstPage?trackId="+data.trackId+"&page="+data.page+"&pageSize="+data.pageSize,
        method:"GET",
        
    })
}

// 听单

export let initTingData = (data)=>{
    return request({
        url:"/ting/categories",
        method:"GET",
        
    })
}
// 停单列表
export let initTingListData = (categoryname,pageNum,pageSize)=>{
    return request({
        url:`/ting/categorySubjectList/${categoryname}?pageNum=${pageNum}&pageSize=${pageSize}`,
        method:"GET",
       
    })
}
// 听单详情

export let initTingDetailData = (tingid)=>{
    return request({
        url:`/ting/querySpecialDetail/${tingid}`,
        method:"GET",
       
    })
}

// 分类
export let initCategoryData = (tingid)=>{
    return request({
        url:`/category/queryCategories`,
        method:"GET",
       
    })
}

export let initCategoryListData = (data)=>{
    return request({
        url:`/category/queryCategoryPage`,
        method:"GET",
        params:data,
    })
}


// 搜索页
// 广告热词分类
export let initSearchBannerData = ()=>{
    return request({
        url:`/search/hotWordBillboardCategory`,
        method:"GET",
        
    })
}
// 广告热词列表
export let initSearchBannerListData = (categoryId,size)=>{
    return request({
        url:`/search/hotWordBillboardList?categoryId=${categoryId}&size=${size}`,
        method:"GET",
        
    })
}

// 搜索关键字
export let initSearchKeyworkData = (kw)=>{
    return request({
        url:`/search/recommendSearch?kw=${kw}`,
        method:"GET",
        
    })
}
// https://m.ximalaya.com/revision/suggest

// https://apis.netstart.cn/ximalaya/search?kw=单田芳&core=all&page=1&rows=20


// export let initAllSearchData = (kw,core)=>{
//     return request({
//         url:`https://apis.netstart.cn/ximalaya/search?kw=${kw}&core=${core}&page=1&rows=10`,
//         method:"GET",
        
//     })
// }
export let initAllSearchData = (params)=>{
    return request({
        url:`https://apis.netstart.cn/ximalaya/search`,
        method:"GET",
        params
    })
}



// 测试
export let test = (params)=>{
    return request({
        url:"/anchor/queryAnchorTracksByPage",
        // url:"/anchor/queryAnchorTracksByPage?anchorId=2629577&page=2&pageSize=20&asc=false",
        // url:"/anchor/queryAnchorTracksByPage",
        method:"GET",
        params
    })
}